package com.xr.outside;

import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.common.*;
import com.xr.common.CommUtil;

/**
 * dataListener
 */
public class dataListener extends AbstractDatasetListener {
  public boolean beforeLoadData(Dataset dataset)
     throws Exception {
	  String className = dataset.parameters().getString("className");
	  	String sql = "";
	  		SqlDataset ds = (SqlDataset) dataset;
	  		if (className != null && className.equals("inputBusinessStatData_datasetBusinessStatData")) { //
	  			sql = ds.getSql();
	  			sql += CommUtil.setConditionSQL(ds);
		  		ds.setSql(sql+" order by bs.yearmonth desc");
	  		}
	  		if (className != null && className.equals("inputDeptSale_datasetDeptSale")) { //
	  			sql = ds.getSql();
	  			sql += CommUtil.setConditionSQL(ds);
		  		ds.setSql(sql+"");
	  		}
	  		
	  		
	      return true;

  }

  public void afterLoadData(Dataset dataset)
     throws Exception {

  }

}
